﻿using System.Runtime.InteropServices;
using static SedecimBase.SystemInfo;

namespace SedecimBase
{
	internal class 拉取新版本
	{
		LibGit2Sharp.CloneOptions m_克隆选项;
		string 远程链接= "https://github.com/libgit2/libgit2sharp.git";
	}
	public class Syn_
	{

	}

public class SystemInfo
	{
		[DllImport("kernel32", SetLastError = true)]
		static extern void GetNativeSystemInfo(out SYSTEM_INFO lpSystemInfo);

		[DllImport("kernel32", SetLastError = true)]
		static extern void GetSystemInfo(out SYSTEM_INFO lpSystemInfo);

		[StructLayout(LayoutKind.Sequential)]
		public struct SYSTEM_INFO
		{
			public uint dwOemId;
			public uint dwPageSize;
			public IntPtr lpMinimumApplicationAddress;
			public IntPtr lpMaximumApplicationAddress;
			public IntPtr dwActiveProcessorMask;
			public uint dwNumberOfProcessors;
			public uint dwProcessorType;
			public uint dwAllocationGranularity;
			public ushort wProcessorLevel;
			public ushort wProcessorRevision;
		}
		public static void Main2()
		{
			var systemInfo = new SYSTEM_INFO();
			GetSystemInfo(out systemInfo); // 获取当前系统的信息，包括逻辑处理器数和CPU核心数
			GetNativeSystemInfo(out systemInfo); // 获取本机系统的原始信息，包括逻辑处理器数和CPU核心数
												 // 判断逻辑处理器数是否大于CPU核心数，如果是，则超线程被启用
			bool isHyperThreadingEnabled = (systemInfo.dwNumberOfProcessors > systemInfo.dwActiveProcessorMask.ToInt32());
			Console.WriteLine($"Is Hyper-Threading enabled: {isHyperThreadingEnabled}");
		}
	}}
